using System;
using Whitemice.MOGI;

namespace Whitemice.MOGI.ZOGI
{
	public abstract class OwnedDocument : Whitemice.MOGI.ZOGI.Document, IOwnedDocument
	{
		public OwnedDocument(IServer server, Payload payload) 
			: base(server, payload)
		{
		}
		
		/// \brief Return true			
		protected bool HasOwner {
			get {
				return true;
			}
		}
		
		/// \brief Return the owner.id value
		internal int OwnerId 
		{
			get { return payload.GetIntForKey("ownerObjectId"); }
		}
				
		/// \brief Return the owner.login value
		protected string OwnerLogin 
		{
			get { return null; }
		}
		
		/// \todo Implement
		public string Owner 
		{
			get 
			{ 
				return "Document/Account/" + 
							  payload.GetIntForKey("ownerObjectId").ToString(); 
			}
		}
	}
}
